/**
 * 
 */
package edu.serg.mbar.algorithms.combiningalgorithms;

import java.util.Vector;

import org.apache.log4j.Logger;

import edu.serg.mbar.algorithms.functions.TimeLessThan;
import edu.serg.mbar.ucon.interfaces.CombiningAlgorithm;

/**
 * @author Sanaullah
 *
 */
public class All implements CombiningAlgorithm {

	Logger log =Logger.getLogger(All.class);
	
	/* (non-Javadoc)
	 * @see edu.serg.mbar.ucon.interfaces.CombiningAlgorithm#combine(java.util.Vector)
	 */
	@Override
	public boolean combine(Vector<Boolean> resultSet) {
		// TODO Auto-generated method stub
		log.info("Analyzing the Results of all the expressions in the Condition Node");
		boolean result =true;
		int i=0;
		for(Boolean b: resultSet){
			
			log.debug("The value of item(" + i +") is " + b.booleanValue());
			if (!b.booleanValue()){
				result= false;
				break;
			}
			i=i+1;
		}
		log.debug("The value returned is " + result);
		return result;
	}

}
